<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
  <HEAD>
  </HEAD>
  <BODY>
    Peer groups are formed as a collection of peers that have agreed upon a 
    common set of services. The {@link net.jxta.peergroup.PeerGroup} interface presents the
    API of those services and encapsulates the group's identity and the local 
    peer's identity in that group.
    
    <p/>A group is instantiated on a peer by instantiating the group class
    specified by the group definition and initializing the resulting object
    with the parameters specified by the group definition.
    
    <p/>A group may be, and often is, defined and instantiated within the 
    context of another group referred to as its parent group. In that case an
    appropriate and initialized {@link net.jxta.peergroup.PeerGroup} object, 
    that represents that group may be obtained from the parent group by using 
    one of the parent's {@link net.jxta.peergroup.PeerGroup#newGroup newGroup} 
    methods.
    
    <p/>All peers start with instantiating one well known root group
    (which has no parent) known as the <em>World Peer Group</em>. It is created
    by calling {@link net.jxta.peergroup.PeerGroupFactory#newPlatform()}.
    
    <p/>The <em>World Peer Group</em> has a limited set of functionality. Most 
    peers chose to instantiate early on another well known group known as the 
    <em>Net Peer Group</em> and to use it as the root of the other groups they 
    create.
    
    <p/>An object representing the <em>Net Peer Group</em> may be obtained from 
    the {@link net.jxta.peergroup.PeerGroupFactory} by invoking the method 
    {@link net.jxta.peergroup.PeerGroupFactory#newNetPeerGroup()}. This method
    invokes {@link net.jxta.peergroup.PeerGroupFactory#newPlatform()} 
    automatically, so if an application wants to use the <em>Net Peer Group</em> 
    as its root group, invoking 
    {@link net.jxta.peergroup.PeerGroupFactory#newNetPeerGroup()} is all that is
    required.
    
    <p/>All other groups should be created or instantiated within the context of
    already instantiated groups by using one of the
    {@link net.jxta.peergroup.PeerGroup#newGroup newGroup} methods.
    
    <p/>It is possible to change the identity, name, and description of the
    group that {@link net.jxta.peergroup.PeerGroupFactory#newNetPeerGroup()} 
    instantiates by setting the following properties in the file 
    <code>config.properties</code> (all three must be specified for the setting 
    to take effect):
    <ul>
      <li><code>NetPeerGroupID</code></li>
      <li><code>NetPeerGroupName</code></li>
      <li><code>NetPeerGroupDesc</code></li>
    </ul>
    The same result may be obtained by invoking the following 
    {@link net.jxta.peergroup.PeerGroupFactory} static methods:
    <ul>
      <li>{@link net.jxta.peergroup.PeerGroupFactory#setNetPGID}</li>
      <li>{@link net.jxta.peergroup.PeerGroupFactory#setNetPGName}</li>
      <li>{@link net.jxta.peergroup.PeerGroupFactory#setNetPGDesc}</li>
    </ul>
    
    <p/>It is also possible to create arbitrary subgroups of the <em>World Peer
    Group</em> programatically by first starting the <em>World Peer Group</em>
    and applying one of the 
    {@link net.jxta.peergroup.PeerGroup#newGroup newGroup} methods of the 
    resulting <tt>PeerGroup</tt> object. An example of creating multiple
    infrastructure peer groups.
    {@link <a href="https://jxta-jxse.dev.java.net/source/browse/jxta-jxse/trunk/tutorials/src/tutorial/multinetgroup/">Multiple Infrastructure Group Tutorial</a>}
      
      
      @see net.jxta.peergroup.PeerGroup
      @see net.jxta.peergroup.PeerGroupFactory
      @see net.jxta.protocol.PeerGroupAdvertisement
      @see net.jxta.protocol.PeerAdvertisement
      @see net.jxta.id.ID
      @see <a href="https://jxta-spec.dev.java.net/nonav/JXTAProtocols.html#overview-peergroups">JXTA Protocols Specification : Peer Groups</a>
  </BODY>
</HTML>
